﻿using NPOI.SS.UserModel;

namespace Soul.Excel
{
    public class ExcelStyle : ICellStyle
    {
        private ICellStyle _style;

        public ExcelStyle(ICellStyle style)
        {
            _style = style;
        }

        public void ApplyDefalt()
        {
            _style.BorderBottom = BorderStyle.Thin;
            _style.BorderTop = BorderStyle.Thin;
            _style.BorderLeft = BorderStyle.Thin;
            _style.BorderRight = BorderStyle.Thin;
            _style.WrapText = true;
            _style.VerticalAlignment = VerticalAlignment.Center;
            _style.Alignment = HorizontalAlignment.Center;
        }

        public bool ShrinkToFit { get => _style.ShrinkToFit; set => _style.ShrinkToFit = value; }

        public short Index => _style.Index;

        public short DataFormat { get => _style.DataFormat; set => _style.DataFormat = value; }

        public short FontIndex => _style.FontIndex;

        public bool IsHidden { get => _style.IsHidden; set => _style.IsHidden = value; }
        public bool IsLocked { get => _style.IsLocked; set => _style.IsLocked = value; }
        public HorizontalAlignment Alignment { get => _style.Alignment; set => _style.Alignment = value; }
        public bool WrapText { get => _style.WrapText; set => _style.WrapText = value; }
        public VerticalAlignment VerticalAlignment { get => _style.VerticalAlignment; set => _style.VerticalAlignment = value; }
        public short Rotation { get => _style.Rotation; set => _style.Rotation = value; }
        public short Indention { get => _style.Indention; set => _style.Indention = value; }
        public BorderStyle BorderLeft { get => _style.BorderLeft; set => _style.BorderLeft = value; }
        public BorderStyle BorderRight { get => _style.BorderRight; set => _style.BorderRight = value; }
        public BorderStyle BorderTop { get => _style.BorderTop; set => _style.BorderTop = value; }
        public BorderStyle BorderBottom { get => _style.BorderBottom; set => _style.BorderBottom = value; }
        public short LeftBorderColor { get => _style.LeftBorderColor; set => _style.LeftBorderColor = value; }
        public short RightBorderColor { get => _style.RightBorderColor; set => _style.RightBorderColor = value; }
        public short TopBorderColor { get => _style.TopBorderColor; set => _style.TopBorderColor = value; }
        public short BottomBorderColor { get => _style.BottomBorderColor; set => _style.BottomBorderColor = value; }
        public FillPattern FillPattern { get => _style.FillPattern; set => _style.FillPattern = value; }
        public short FillBackgroundColor { get => _style.FillBackgroundColor; set => _style.FillBackgroundColor = value; }
        public short FillForegroundColor { get => _style.FillForegroundColor; set => _style.FillForegroundColor = value; }
        public short BorderDiagonalColor { get => _style.BorderDiagonalColor; set => _style.BorderDiagonalColor = value; }
        public BorderStyle BorderDiagonalLineStyle { get => _style.BorderDiagonalLineStyle; set => _style.BorderDiagonalLineStyle = value; }
        public BorderDiagonal BorderDiagonal { get => _style.BorderDiagonal; set => _style.BorderDiagonal = value; }

        public IColor FillBackgroundColorColor => _style.FillBackgroundColorColor;

        public IColor FillForegroundColorColor => _style.FillForegroundColorColor;

        public bool IsQuotePrefixed { get => _style.IsQuotePrefixed; set => _style.IsQuotePrefixed = value; }

        public void CloneStyleFrom(ICellStyle source)
        {
            _style.CloneStyleFrom(source);
        }

        public string GetDataFormatString()
        {
            return _style.GetDataFormatString();
        }

        public IFont GetFont(IWorkbook parentWorkbook)
        {
            return _style.GetFont(parentWorkbook);
        }

        public void SetFont(IFont font)
        {
            _style.SetFont(font);
        }
    }
}
